<!--
 * @Author: ChunLai
 * @Date: 2022-01-17 11:39:06
 * @LastEditTime: 2025-08-12 17:53:32
 * @Description: 用户信息/投被保人
 * @FilePath: \02.bldinsure\src\views\sign\components\infos\UserInfos.vue
-->
<template>
  <div class="customer_infos">
    <div class="notice-mode-head">
      <span class="head-box">{{ titleTxt }}</span>
      <span
        :class="enfold ? 'ms-row2-icon' : 'ms-row-icon'"
        style="margin-left: 8px"
        @click="enfold = !enfold"
      ></span>
    </div>
    <ul class="list_ul_box" v-show="enfold">
      <van-cell
        v-if="demoInfo.relationToAppnt !== void 0"
        title="是投保人的："
        :value="msgObj.relationToAppntName"
      />
      <template v-if="!(uType == 'bbr' && msgObj.relationToAppnt == '4')">
        <van-cell v-if="msgObj.name" title="姓名：" :value="msgObj.name" />
        <van-cell
          v-if="msgObj.phone"
          title="手机号码："
          :value="msgObj.phone"
        />
        <van-cell
          v-if="msgObj.idName"
          title="证件类型："
          :value="msgObj.idName"
        />
        <van-cell
          v-if="msgObj.idNum"
          title="证件证号："
          :value="msgObj.idNum"
        />
        <van-cell v-if="msgObj.validDateEnd" title="证件有效期：">
          {{
            msgObj.validDateEnd == longTime ? "长期有效" : msgObj.validDateEnd
          }}
        </van-cell>
        <van-cell
          v-if="msgObj.sexName"
          title="性别："
          :value="msgObj.sexName"
        />
        <van-cell
          v-if="msgObj.birthDate"
          title="出生日期："
          :value="msgObj.birthDate"
        />
        <van-cell
          v-if="msgObj.occupationCodeName"
          title="职业名称："
          :value="msgObj.occupationCodeName"
        />
        <van-cell
          v-if="demoInfo.socialInsuFlag !== void 0"
          title="是否有社保："
        >
          {{ msgObj.socialInsuFlag == "Y" ? "有" : "无" }}
        </van-cell>
        <van-cell
          v-if="demoInfo.nationalityName !== void 0"
          title="国籍："
          :value="msgObj.nationalityName"
        >
        </van-cell>
        <van-cell
          v-if="demoInfo.residentTypeName !== void 0"
          title="居民类型："
          :value="msgObj.residentTypeName"
        >
        </van-cell>
        <van-cell
          v-if="demoInfo.height !== void 0"
          title="身高（CM）："
          :value="msgObj.height"
        >
        </van-cell>
        <van-cell
          v-if="demoInfo.weight !== void 0"
          title="体重（KG）："
          :value="msgObj.weight"
        >
        </van-cell>
        <van-cell
          v-if="demoInfo.degreeName !== void 0"
          title="学历："
          :value="msgObj.degreeName"
        >
        </van-cell>
        <van-cell
          v-if="demoInfo.crsIdTypeName !== void 0"
          title="税收居民身份类型："
          :value="msgObj.crsIdTypeName"
        >
        </van-cell>
        <van-cell
          v-if="demoInfo.email !== void 0"
          title="邮箱："
          :value="msgObj.email"
        >
        </van-cell>
        <van-cell
          v-if="demoInfo.maritalStatusName !== void 0"
          title="婚姻状况："
          :value="msgObj.maritalStatusName"
        >
        </van-cell>
        <van-cell
          v-if="demoInfo.rgtName !== void 0"
          title="户籍："
          :value="msgObj.rgtName"
        >
        </van-cell>
        <van-cell
          v-if="demoInfo.rgtAddress !== void 0"
          title="户籍地址："
          :value="msgObj.rgtAddress"
        >
        </van-cell>
        <van-cell
          v-if="demoInfo.permanentAddress !== void 0"
          title="现居地址："
        >
          {{ msgObj.areaName }}<br />{{ msgObj.permanentAddress }}
        </van-cell>
        <van-cell
          v-if="demoInfo.postalPermanentAddress !== void 0"
          title="通讯地址："
        >
          {{ msgObj.postalAreaName }}<br />{{ msgObj.postalPermanentAddress }}
        </van-cell>
        <van-cell
          v-if="demoInfo.homePermanentAddress !== void 0"
          title="家庭地址："
        >
          {{ msgObj.homeAreaName }}<br />{{ msgObj.homePermanentAddress }}
        </van-cell>
        <van-cell
          v-if="demoInfo.zipCode !== void 0"
          title="邮政编码："
          :value="msgObj.zipCode"
        >
        </van-cell>
        <van-cell
          v-if="demoInfo.grpName !== void 0"
          title="工作单位："
          :value="msgObj.grpName"
        >
        </van-cell>
        <van-cell
          v-if="demoInfo.incomeLevel !== void 0"
          title="年收入："
          :value="msgObj.incomeLevel"
        >
        </van-cell>
      </template>
    </ul>
  </div>
</template>

<script>
import { mapGetters } from "vuex";
export default {
  name: "UserInfos",
  props: {
    titleTxt: {
      type: String,
      default: () => "投保人",
    },
    uType: {
      type: String,
      default: () => "tbr",
    },
    msgObj: {
      type: Object,
      default: () => {},
    },
  },
  data() {
    return {
      enfold: true,
    };
  },
  computed: {
    ...mapGetters({
      longTime: "dictionary/longTime",
      inputReg: "infoReg/inputReg",
      applicant: "insert/applicant",
    }),
    demoInfo() {
      let res = {};
      const inptDemo = this.inputReg;
      if (inptDemo.applicant || inptDemo.insured) {
        res = this.uType === "tbr" ? inptDemo.applicant : inptDemo.insured;
      }
      return res;
    },
  },
  created() {},
  methods: {},
};
</script>

<style lang="less" scoped>
@import "./style.less";
</style>
